Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
@sinonjs/commons
Advanced tools
The @sinonjs/commons package is a collection of common utilities used by Sinon.js and its related projects. It provides a set of helper functions and shared components that are used across the Sinon.js ecosystem to ensure consistency and reduce duplication.
typeOf
Determines the type of a given value. It is a more robust version of JavaScript's typeof operator.
const { typeOf } = require('@sinonjs/commons');
const result = typeOf({}); // 'object'
valueToString
Converts a value to a string representation, useful for debugging and logging.
const { valueToString } = require('@sinonjs/commons');
const result = valueToString('Hello'); // '"Hello"'
isPromise
Checks if a given value is a Promise.
const { isPromise } = require('@sinonjs/commons');
const result = isPromise(Promise.resolve()); // true
Lodash is a comprehensive utility library offering a wide range of functions for tasks such as manipulating arrays, objects, and strings. It is larger in scope compared to @sinonjs/commons, which is more focused on utilities specifically for Sinon.js.
Underscore is another utility library similar to Lodash, providing functional programming helpers for JavaScript. It is less modular than @sinonjs/commons, which is designed to work within the Sinon.js ecosystem.
Ramda is a functional programming library that emphasizes a more functional style of JavaScript coding than @sinonjs/commons. It provides utilities for working with functions, arrays, and objects in a functional manner.
Simple functions shared among the sinon end user libraries
3.0.1
f82068f
chore: remove obsolete IE11 code (Morgan Roderick)
When we upgraed to @sinonjs/eslint-config@4 in 09e99f4e310c20408df50330124e4d68a60e9b6a we effectively removed support for IE11.
That means that this code branch is obsolete and is safe to remove.
Released by Morgan Roderick on 2024-01-20.
FAQs
Simple functions shared among the sinon end user libraries
The npm package @sinonjs/commons receives a total of 24,161,998 weekly downloads. As such, @sinonjs/commons popularity was classified as popular.
We found that @sinonjs/commons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.